import request from '@/utils/request'

// 查询卡券明细列表
export function listCard(query) {
  return request({
    url: '/prod-api/activity/card/list',
    method: 'get',
    params: query
  })
}

// 查询卡券明细详细
export function getCard(cardUid) {
  return request({
    url: '/prod-api/activity/card/' + cardUid,
    method: 'get'
  })
}

// 新增卡券明细
export function addCard(data) {
  return request({
    url: '/prod-api/activity/card',
    method: 'post',
    data: data
  })
}

// 修改卡券明细
export function updateCard(data) {
  return request({
    url: '/prod-api/activity/card',
    method: 'put',
    data: data
  })
}

// 删除卡券明细
export function delCard(cardUid) {
  return request({
    url: '/prod-api/activity/card/' + cardUid,
    method: 'delete'
  })
}
// 修改卡券状态
export function updateDataStatus(cardUid, cardStatus){
  const data = {
    cardUid,
    cardStatus
  }
  return request({
    url: '/prod-api/activity/card/updateDataStatus',
    method: 'put',
    data: data
  })
}

// 修改发送状态
export function updateSendStatus(cardUid, sendStatus){
  const data = {
    cardUid,
    sendStatus
  }
  return request({
    url: '/prod-api/activity/card/updateSendStatus',
    method: 'put',
    data: data
  })
}